#ifndef KEYBOARDMANAGER_H
#define KEYBOARDMANAGER_H
#include <windows.h>
#include <vector>
#include <map>

// For a nearly complete list of keycodes, Visit:
//		http://www.kbdedit.com/manual/low_level_vk_list.html
//
// NEVER use the raw values (It's just bad code). If you do, put a comment
// for the key translation at the end of line. To use a letter (ie: R, W, A, S, or D),
// use 'K' for the char value, make sure it is capital.

class KeyboardManager
{
	public:
		static void Init();
		static void Update();
		static void KeyDown(WPARAM key);
		static void KeyUp(WPARAM key);

		/* Key Checking */
		static bool IsDown(WPARAM key);
		static std::vector<WPARAM> GetAllDownKeys();

		static bool IsPressed(WPARAM key);
		static std::vector<WPARAM> GetAllPressedKeys();

		static bool IsReleased(WPARAM key);
		static std::vector<WPARAM> GetAllReleasedKeys();

	protected:
		static std::map<WPARAM, bool> PrevKeyStates;
		static std::map<WPARAM, bool> KeyStates;
	private:
		//Static class
		KeyboardManager() = default;
		virtual ~KeyboardManager() = default;

		//Utility Functions
		static bool ContainsKey(std::map<WPARAM, bool>, WPARAM);
};

#endif // KEYBOARDMANAGER_H
